Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC: use pipeline generator #38162

Merged
merged 45 commits into from
Mar 20, 2024
Merged

PoC: use pipeline generator #38162

merged 45 commits into from
Mar 20, 2024

Conversation

v1v
Copy link
Member

@v1v v1v commented Mar 4, 2024

Proposed commit message

Tasks

  • Enable when conditions.
    • GitHub comment - for individual stages and groups
    • GitHub labels - for individual stages
    • Changeset
    • Branches
  • Use catalog to generate the pipeline itself, rather than calling a python script on a pipeline.yaml file.
  • Support draft PRs.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 4, 2024
@mergify mergify bot assigned v1v Mar 4, 2024
Copy link
Contributor

mergify bot commented Mar 4, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @v1v? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 4, 2024

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 79 min 25 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@alexsapran alexsapran requested a review from dliappis March 4, 2024 09:59
@@ -0,0 +1,44 @@
projects:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What beats are onboarded to this automated pipeline generator.

These are folders from the top of the project. They should also host a similar buildkite.yml file.

auditbeat/buildkite.yml Show resolved Hide resolved
auditbeat/buildkite.yml Show resolved Hide resolved
auditbeat/buildkite.yml Show resolved Hide resolved
auditbeat/buildkite.yml Outdated Show resolved Hide resolved
# - GitHub label <sub-stage-name> . i.e: integTest or unitTest-arm or unitTest-macos ...
extended:
# NOTE: stage name should be unique!
integTest:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step can be forced to run using:

  • The GitHub comment /test auditbeat integTest
  • The GitHub label auditbeat-integTest

integTest:
command: "mage build integTest"
platform: "core-ubuntu-2004-aarch64"
integTest-arm:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step can be forced to run using:

  • The GitHub comment /test auditbeat integTest-arm
  • The GitHub label auditbeat-integTest-arm

# - on PRs if:
# - GitHub comment /test auditbeat <sub-stage-name> . i.e: /test auditbeat integTest
# - GitHub label <sub-stage-name> . i.e: integTest or unitTest-arm or unitTest-macos ...
extended:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the stages in the extended meta-stage will be triggered for PRs using:

  • The GitHub comment /test auditbeat-extended
  • The GitHub label extended-auditbeat

@pazone
Copy link
Contributor

pazone commented Mar 4, 2024

If I understand correctly it allows us to keep the previously created Jenkinsfile.yml-based approach without any significant structural changes.
Let's figure out what else we need to do to make it work e.g. secrets management, hooks, conditional tools installation, etc.

@v1v
Copy link
Member Author

v1v commented Mar 4, 2024

buildkite test auditbeat

@v1v v1v mentioned this pull request Mar 4, 2024
6 tasks

def create_entity(self):
data = """
{% if group.steps|length > 0 %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we switch from templating the YAML to just doing something along the lines of

import yaml
# ...
yaml.dumps(self)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it was just a quick PoC to illustrate how this could work. Moving from one implementation to another is totally fine and makes sense if that's the way to move this forward :)

@pazone
Copy link
Contributor

pazone commented Mar 15, 2024

Added:

  • changeset functionality,
  • aws and orka support,
  • applied beats images for jobs.
    The pipeline generation is tested on filebeat and auditbeat. It works fine but I'm facing issues with filebeat crosscompile. It's not related to the pipeline generation logic.

I think we can merge this PR.

Further improvements:

  • change pipeline generation for comments (now it doesn't work properly)
  • unit tests for the pipeline.py

@pazone pazone marked this pull request as ready for review March 15, 2024 00:46
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @v1v

Copy link
Member

@norrietaylor norrietaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexsapran alexsapran merged commit 4b7467b into main Mar 20, 2024
63 of 67 checks passed
@alexsapran alexsapran deleted the feature/buildkite branch March 20, 2024 14:27
@alexsapran alexsapran added the backport-v8.13.0 Automated backport with mergify label Mar 20, 2024
mergify bot pushed a commit that referenced this pull request Mar 20, 2024
This commit introduces a main pipeline generator similar to the one used with Jenkins #20104 to help with the migration to Buildkite.

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Co-authored-by: Alexandros Sapranidis <alexandros@elastic.co>
(cherry picked from commit 4b7467b)
@pazone pazone added backport-v8.12.0 Automated backport with mergify backport-7.17 Automated backport to the 7.17 branch with mergify labels Mar 20, 2024
mergify bot pushed a commit that referenced this pull request Mar 20, 2024
This commit introduces a main pipeline generator similar to the one used with Jenkins #20104 to help with the migration to Buildkite.

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Co-authored-by: Alexandros Sapranidis <alexandros@elastic.co>
(cherry picked from commit 4b7467b)
mergify bot pushed a commit that referenced this pull request Mar 20, 2024
This commit introduces a main pipeline generator similar to the one used with Jenkins #20104 to help with the migration to Buildkite.

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Co-authored-by: Alexandros Sapranidis <alexandros@elastic.co>
(cherry picked from commit 4b7467b)

# Conflicts:
#	.buildkite/hooks/pre-command
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 21, 2024
@alexsapran alexsapran added the ci label Mar 21, 2024
pazone pushed a commit that referenced this pull request Mar 21, 2024
This commit introduces a main pipeline generator similar to the one used with Jenkins #20104 to help with the migration to Buildkite.

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Co-authored-by: Alexandros Sapranidis <alexandros@elastic.co>
(cherry picked from commit 4b7467b)

# Conflicts:
#	.buildkite/hooks/pre-command

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
pazone pushed a commit that referenced this pull request Mar 21, 2024
This commit introduces a main pipeline generator similar to the one used with Jenkins #20104 to help with the migration to Buildkite.

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Co-authored-by: Alexandros Sapranidis <alexandros@elastic.co>
(cherry picked from commit 4b7467b)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
alexsapran pushed a commit that referenced this pull request Mar 22, 2024
This commit introduces a main pipeline generator similar to the one used with Jenkins #20104 to help with the migration to Buildkite.

Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
Co-authored-by: Alexandros Sapranidis <alexandros@elastic.co>
(cherry picked from commit 4b7467b)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.12.0 Automated backport with mergify backport-v8.13.0 Automated backport with mergify ci Team:Ingest-EngProd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants